package com.biz.primus.management.depot.feign;

import com.biz.primus.common.vo.SpringPageVO;
import com.biz.primus.management.depot.degraded.DegradedDepotFeignClient;
import com.biz.primus.model.depot.enums.BusinessStatus;
import com.biz.primus.model.depot.vo.DepotDetailRespVo;
import com.biz.primus.model.depot.vo.DepotListRespVo;
import com.biz.primus.model.depot.vo.DepotQueryReqVo;
import com.biz.primus.model.depot.vo.DepotRespVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Optional;

/**
 * @Auther JKLiues
 * @Date 2017/9/21
 */
@FeignClient(qualifier = "depotFeignClient", name = "service-depot", fallback = DegradedDepotFeignClient.class)
public interface DepotFeignClient {


    @PostMapping("soa/depotService/searchDepots")
    SpringPageVO<DepotListRespVo> searchDepots(@RequestBody DepotQueryReqVo reqVo);

    @GetMapping("soa/depotService/getByDepotCodeFDb")
    Optional<DepotRespVo> getDepotByDepotCode(@RequestParam("depotCode") String depotCode);

    @GetMapping("soa/depotService/updateBusinessStatus")
    void updateBusinessStatus(@RequestParam("depotId") Long depotId, @RequestParam("businessStatus") BusinessStatus businessStatus);

    @GetMapping("soa/depotService/findByIdFDb")
    DepotDetailRespVo findByIdFDb(@RequestParam("depotId") Long depotId);
}
